package cn.gok.day3;

import java.util.Scanner;

/**
 * @ClassName Main
 * @Description TODO
 * @Author HP
 * @Date 19:21 2022/7/6
 * @Version 1.0
 **/
public class Main {
    public static void main(String[] args) {
        Person p1=new Person("Oscar","男",22,false);
        Person p2=new Person("wang","0",22,false);
//        匿名内部类
        Person niming=new Person("Oscar","男",22,false){
            @Override
            public void study(String school) {
//                修改：时间靠自己输入
                System.out.println("请输入学习的时间：");
                int time= new Scanner(System.in).nextInt();
                System.out.println("匿名内部类重写study方法："+this.getName()+"在"+school+"学习了"+time+"年啦");

            }
        };
        niming.study("泉州职业技术大学");

    }
}
